import {queryHospital} from "@/api"

const state = {
  hospitalList:[],
  loading:false
}

const mutations = {
 HOSPITALLIST(context, data){
   context.hospitalList = data
 },
 LOADING(context, flag){
   context.loading = flag
 }
}

const actions = {
 async hospitalList({commit}, data){
   commit("LOADING", true)
   let result = await queryHospital(data)
   commit("HOSPITALLIST", result.data)
   commit("LOADING", false)
 }
}

const getters = {}

export default {
  state,
  mutations,
  actions,
  getters
}